package com.dyw.Day32;

import java.util.LinkedList;
import java.util.List;

/**
 * @author Devil
 * @create 2022-04-10 0:10
 */
public class Demo01 {
    public List<String> fizzBuzz(int n) {

        LinkedList<String> strings = new LinkedList<>();
        for (int i = 1; i <= n; i++) {
            if (i%3==0&&i%5==0){
                strings.add("FizzBuzz");
            }else if(i%3==0){
                strings.add("Fizz" );
            }else if(i%5==0){
                strings.add("Buzz");
            }else{
                strings.add(String.valueOf(i));
            }
        }

        return strings;
    }
}
